package com.sanley.piss.web.controller;

import com.gitee.dreamkaylee.shiro.util.SubjectUtil;
import com.sanley.piss.model.vo.LoginUser;

import java.util.Set;

/**
 * Create By  on 2021/3/25.
 *
 * @author 张凯大天才
 */
public abstract class AbstractController {
    protected LoginUser getCurrentUser() {
        return SubjectUtil.getPrincipal(LoginUser.class);
    }

    protected Integer getCurrentUserId() {
        return Integer.valueOf(getCurrentUser().getUserId());
    }

    protected Set<String> getCurrentUserRoles() {
        return getCurrentUser().getRoles();
    }
}
